#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int tribonacci(int n) {
        int arr[38] = { 0,1,1 };
        for (int i = 3; i < 38; i++)
        {
            arr[i] = arr[i - 3] + arr[i - 2] + arr[i - 1];
        }
        return arr[n];

    }
};